package iscript.coreFramework.util 
{
		import flash.utils.Dictionary;
		public class DictionaryUtil
		{
			   
  
				static public function hasKey(d:Dictionary, keyName:*):Boolean
				{
						for (var key:Object in d)
							{
								if (key == keyName) return true;
							}
							return false;
				}			   
				
				static public function formatToObject(d:Dictionary):Object
				{
					 var  data:Object = new Object();
					 for (var key:String in d) {
						     data[key] = d[key];					 
						  }
					 return data;
				}				
  
				static public function getKeys(d:Dictionary):Array
				{
						var a:Array = new Array();
						for (var key:Object in d) a.push(key);
						return a;
				}
				
				static public function getValues(d:Dictionary):Array
				{
						var a:Array = new Array();
						for each (var value:Object in d) a.push(value);
						return a;
				}
			   

				static public function getValuesOfKeys(d:Dictionary, keys:Array):Array
				{
						var a:Array = new Array();
						var n:uint = keys.length;
						for (var i:uint = 0; i < n; i++) a.push(d[keys[i]]);
						return a;
				}
			   

				static public function length(d:Dictionary):uint
				{
						var a:Array = new Array();
						for (var key:Object in d) a.push(key);
						return a.length;
				}
		 }
	}